#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/10/31 12:19
# @Author  : Triste_hui

from game_db import *


class Combat(object):   # 战斗用
    def __init__(self):
        self.name = ""  # 名字
        self.hp = 0     # 生命
        self.atk = 0    # 攻击
        self.defe = 0   # 防御
        self.lv = 0     # 等级


class Equip(object):   # 装备
    def __init__(self, name="", id=0, quality=0, lv=0, atk=0, defe=0, hp=0, side=0):
        self.name = name    # 装备名
        self.id = id    # 装备id
        self.quality = quality  # 装备品质，1白2绿3蓝4紫5橙6史诗
        self.lv = lv    # 装备级别
        self.atk = atk  # 装备带来的攻击力
        self.defe = defe    # 装备带来的防御
        self.hp = hp    # 装备带来的生命值
        self.side = side    # 装备位置

    def set(self, i, l):    # 根据ID和级别初始化装备
        pass

    def buyEq(self, i):     # 根据ID购买装备
        pass

    def getATK(self):   # 返回攻击力
        pass

    def getDEF(self):   # 返回防御力
        pass

    def getHP(self):
        pass

    def getSIDE(self):
        pass

    def getLV(self):
        pass

    def getQU(self):
        pass

    def getNAME(self):
        pass

    def setSIDE(self, s):   # 设置装备位置，移出卡牌的装备时使用
        pass

    def show(self):     # 显示装备属性
        pass

    def getLVLimit(self):   # 装备级别限制
        pass

    def operator(self, i):
        pass

    def isHere(self):   # 装备是否存在
        pass


class Player(object):   # 玩家
    def __init__(self):
        self.id = None
        self.name = None
        self.card = None
        self.cardbk = None
        self.gold = None
        self.diamond = None
        self.lv = None
        self.stars = None
        self.eqbank = None
        self.map = None

    def getGold(self):
        return self.gold

    def getDiamond(self):
        return self.diamond

    def getLV(self):
        return self.lv

    def getStars(self):
        return self.stars

    def getMAP(self):
        return self.map

    def getName(self):
        return self.name

    def addMAP(self, m):
        self.map = m

    def addGold(self, g):
        self.gold += g

    def addDiamond(self, d):
        self.diamond += d

    def addLV(self):
        self.lv += 1

    def addStars(self, s):
        self.stars += s

    def save(self):
        pass

    def load(self, **result):
        self.id = result.get('id')
        self.name = result.get('name')
        self.gold = result.get('gold')
        self.diamond = result.get('diamond')
        self.lv = result.get('lv')
        self.card = result.get('card')

    def create(self):
        pass

    def show(self):
        pass

